#!/usr/bin/env python
# encoding: utf-8
'''
@author: wangjianrong
@software: pycharm
@file: 1.py
@time: 2020/10/10 11:26
@desc:
'''
from multiprocessing import Process, Queue

# def f(q):
#     q.put([42, None, 'hello'])
#
# if __name__ == '__main__':
#     q = Queue()
#     p = Process(target=f, args=(q,))
#     p.start()
#     print(q.get())    # prints "[42, None, 'hello']"
#     p.join()



q = Queue(maxsize=100)
def f(v):
    for i in range(v):
        q.put(i)

if __name__ == '__main__':
    p = Process(target=f,args=(10,))
    p.start()
    p.join()
    print(q.qsize())